<?php include_once("../../../common/common_setting_unit.php");         // 引入通用的设置文件 ?>
<?php include_once(ROOT_PATH_ . "/controller/common/module/head.php"); // 引入通用的头部 ?>
<?php include_once("detail-list-function.php"); ?>

<?php
$_LANG['top'] = '顶部';
$_LANG['middle'] = '中间';
$_LANG['bottom'] = '底部 ';
?>



<body>

<!--顶部栏-->
<div id="topbar"> <?php include ROOT_PATH_ . '/controller/common/module/topbar.php'; ?></div>

<!--容器-->
<div id="container" class="<? echo $now_extender ?>">

    <!--侧边栏-->
    <div id="sidebar"><?php include ROOT_PATH_ . '/controller/common/module/sidebar.php'; ?></div>





    <?
    //==============================================================================
    //这里开始才是平常开发需要注重的部分，其余的基本不用理会
    //==============================================================================
    ?>

        <div id="content">
            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
                <legend><h1>自定义导航栏</h1></legend>
            </fieldset>

            <div class="list-box product-list-box listbox_<? echo $system_part ?>">
				<div class="statistic">
            		
                    <a class="layui-btn" href="detail-add.php?sys_part=nav"><i class="layui-icon">&#x1005;</i> 添加导航</a>
                    
                    <hr/>
                </div>
                <div class="">

                    <table class="layui-table">
                      
                        <thead>
                        <tr>					
                            <th>名称</th>             
                            <th>是否显示</th>
                            <th>是否新窗口</th>
                            <th>排序</th>
                            <th>位置</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>

                    <?php foreach($nav_list as $value) {
						
                        ?>
						<tr>
                    	<td><? echo $value['name']?></td>
                        <td align="center"><img src="/controller/common/asset/image/<? echo $value['ifshow'] == 1 ? "yes" : "no";?>.gif" /></td>
                        <td align="center"><img src="/controller/common/asset/image/<? echo $value['opennew'] == 1 ? "yes" : "no";?>.gif" /></td>
                        <td align="center"><? echo $value['vieworder']; ?></td>
                        <td align="center"><? echo $_LANG[$value['type']];?></td>
                        <td>
                        	<a href="javascript:void(0)" onclick="popupBox(<?php echo $value['id'] ?>)" class="delete layui-btn  layui-btn-sm" > <i class="layui-icon">&#xe640;</i>删除</a>
                                <a href="detail-edit.php?id=<?php echo $value['id'] ?>"  class="modify layui-btn  layui-btn-sm" ><i class="layui-icon">&#xe642;</i> 修改</a>
                        </td>
						</tr>
                    <?php

                    }
                    ?>
					</tbody>
                    </table>

                </div>


                <div class="list-box-function" <? if ($detailnum == 0) {
                    echo "style" . "='display:none'";
                } ?> >
                    <div class="page-guide">

                        <?php
                        if($nowpageid==1)
                        {
                            ?>
                            <!--现在页数在第一页的时候-->
                            <span>首页</span>
                            <span>前一页</span>
                            <!--现在页数非第一页的时候-->
                        <?php
                        }
                        else
                        {
                            ?>
                            <!--现在页数非第一页的时候-->
                            <a href="detail-list.php?sortby=<?php echo $sort_by; ?>&amp;&amp;nid=<?php echo $trans_nid ?>">首页</a>
                            <a href="detail-list.php?nowpageid=<?php echo $prepage; ?>&amp;&amp;sortby=<?php echo $sort_by; ?>&amp;&amp;nid=<?php echo $trans_nid ?>">前一页</a>
                            <!--现在页数非第一页的时候-->
                        <?php
                        }
                        ?>


                        <!--开始列印出所有页码-->

                        <?php
                        $ii=1;
                        $iii=1;
                        while ($ii<=$page_count)
                        {
                            //首先判断是不是当前页

                            if($ii==$nowpageid)
                            {
                                echo "<span>".$ii."</span>";
                            }
                            else if((($ii+5)<$nowpageid)||(($ii-5)>$nowpageid))
                            {
                            }
                            else
                            {
                                echo "<a href='";
                                echo "detail-list.php?nowpageid=";
                                echo $iii;
                                echo "&&sortby=";
                                echo $sort_by;
                                echo "&&nid=";
                                echo $trans_nid;
                                echo "'>";
                                echo $iii;
                                echo "</a>";
                            }

                            $ii++;
                            $iii++;
                        }
                        ?>

                        <!--列印出所有页码 结束-->


                        <?php
                        if($nowpageid==$page_count)
                        {
                            ?>
                            <!--现在页数在第一页的时候-->
                            <span>后一页</span>
                            <span>末页</span>
                            <!--现在页数非第一页的时候-->
                        <?php
                        }
                        else
                        {
                            ?>
                            <!--现在页数非第一页的时候-->
                            <a href="detail-list.php?nowpageid=<?php echo $nextpage; ?>&amp;&amp;sortby=<?php echo $sort_by; ?>&amp;&amp;nid=<?php echo $trans_nid ?>">后一页</a>
                            <a href="detail-list.php?nowpageid=<?php echo $lastpage; ?>&amp;&amp;sortby=<?php echo $sort_by; ?>&amp;&amp;nid=<?php echo $trans_nid ?>">末页</a>
                            <!--现在页数非第一页的时候-->
                        <?php
                        }
                        ?>


                    </div>
                    <!--翻页代码结束-->
                </div>


                <!--list-box end-->
            </div>

            <!--content端點01-->
        </div>

        <!--maincontent端點01-->
        <br class="clearfloat"/>
    </div>
    <!--container端點01-->
</div>

<!--删除box-->
<?php include '../../../modules/deletebar.php'; ?>
<!--删除box end-->

<!--底部栏-->
<?php include ROOT_PATH_ . "/controller/common/module/footer.php"; ?>

</body>
</html>
